package com.atguigu.bean;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * Date:2020/9/15
 * Author:ybc
 * Description:
 */
public class CartItem implements Serializable {

    private Book book;

    private Integer count;

    private Double amount;

    public Book getBook() {
        return book;
    }

    public void setBook(Book book) {
        this.book = book;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Double getAmount() {
        BigDecimal bigDecimal1 = new BigDecimal(book.getPrice()+"");
        BigDecimal bigDecimal2 = new BigDecimal(count+"");
        BigDecimal bigDecimal = bigDecimal1.multiply(bigDecimal2);
        return bigDecimal.doubleValue();
    }

}
